-- CALC_BINE_ATTACK

-- 计算魔藤攻击
-- @param bine    魔藤
return function(bine)
    local level = bine:getLevel();
    local attack;

    if level < 11 then
        attack = math.modf(level + 14);
    elseif level < 21 then
        attack = math.modf((level - 1) * 1.5 + 11);
    else
        attack = math.modf(level* 2 - 1);
    end
    -- 1. 绝对值加成
    local prop = PropM.combine(bine, "attrib2", "attack");
    attack = PropM.apply(prop, attack);

    -- 2. 百分比加成
    prop = PropM.combine(bine, "attrib", "attack");
    attack = PropM.apply(prop, attack);

    -- 玩家对召唤兽属性加成
    local addon_attack = FormulaM.invoke("SUMMON_ATTRIB_ADDITION", bine, attack, "attack");

    -- 所有召唤物能力加
    prop = PropM.combine(ME.user, "summon_attrib", "attack");
    attack = PropM.apply(prop, attack);

    -- 玩家属性加成
    if ME.user:queryAttrib("bine_attrib") > 0 then
        attack = attack + 3;
    end

    return attack + addon_attack;
end
